{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Highcharts Demos\n",
    "=========\n",
    "Percentage area: http://www.highcharts.com/demo/area-stacked-percent\n",
    "-----------------------------------------------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<iframe style=\"border:0;outline:none;overflow:hidden\" srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;utf-8&quot; /&gt;\n",
       "        &lt;link href=&quot;https://www.highcharts.com/highslide/highslide.css&quot; rel=&quot;stylesheet&quot; /&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts-more.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;/head&gt;\n",
       "    &lt;body style=&quot;margin:0;padding:0&quot;&gt;\n",
       "                &lt;div id=&quot;container&quot; style=&quot;width:750px;height:600px;&quot;&gt;Loading....&lt;/div&gt;\n",
       "\n",
       "\n",
       "    &lt;script&gt;\n",
       "        $(function(){\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "            Highcharts.setOptions({&quot;lang&quot;: {}, &quot;global&quot;: {}});\n",
       "            var option = {&quot;loading&quot;: {}, &quot;subtitle&quot;: {&quot;text&quot;: &quot;Source: Wikipedia.org&quot;}, &quot;xAxis&quot;: {&quot;tickmarkPlacement&quot;: &quot;on&quot;, &quot;categories&quot;: [&quot;1750&quot;, &quot;1800&quot;, &quot;1850&quot;, &quot;1900&quot;, &quot;1950&quot;, &quot;1999&quot;, &quot;2050&quot;], &quot;title&quot;: {&quot;enabled&quot;: false}}, &quot;title&quot;: {&quot;text&quot;: &quot;Historic and Estimated Worldwide Population Growth by Region&quot;}, &quot;series&quot;: {}, &quot;labels&quot;: {}, &quot;yAxis&quot;: {&quot;labels&quot;: {&quot;formatter&quot;: function () {                                return this.value ;                            }}, &quot;title&quot;: {&quot;text&quot;: &quot;Billions&quot;}}, &quot;chart&quot;: {&quot;width&quot;: 750, &quot;renderTo&quot;: &quot;container&quot;, &quot;height&quot;: 600}, &quot;tooltip&quot;: {&quot;shared&quot;: true, &quot;valueSuffix&quot;: &quot; millions&quot;}, &quot;plotOptions&quot;: {&quot;area&quot;: {&quot;stacking&quot;: &quot;normal&quot;, &quot;marker&quot;: {&quot;lineWidth&quot;: 1, &quot;lineColor&quot;: &quot;#666666&quot;}, &quot;lineWidth&quot;: 1, &quot;lineColor&quot;: &quot;#666666&quot;}}, &quot;credits&quot;: {&quot;enabled&quot;: false}, &quot;colors&quot;: {}, &quot;pane&quot;: {}, &quot;exporting&quot;: {}, &quot;drilldown&quot;: {}, &quot;navigation&quot;: {}, &quot;legend&quot;: {}};\n",
       "\n",
       "\n",
       "            var data = [{&quot;data&quot;: [502, 635, 809, 947, 1402, 3634, 5268], &quot;type&quot;: &quot;area&quot;, &quot;name&quot;: &quot;Asia&quot;}, {&quot;data&quot;: [106, 107, 111, 133, 221, 767, 1766], &quot;type&quot;: &quot;area&quot;, &quot;name&quot;: &quot;Africa&quot;}, {&quot;data&quot;: [163, 203, 276, 408, 547, 729, 628], &quot;type&quot;: &quot;area&quot;, &quot;name&quot;: &quot;Europe&quot;}, {&quot;data&quot;: [18, 31, 54, 156, 339, 818, 1201], &quot;type&quot;: &quot;area&quot;, &quot;name&quot;: &quot;America&quot;}, {&quot;data&quot;: [2, 2, 2, 6, 13, 30, 46], &quot;type&quot;: &quot;area&quot;, &quot;name&quot;: &quot;Oceania&quot;}]\n",
       "            option.series = data;\n",
       "\n",
       " \n",
       "\n",
       "            var chart = new Highcharts.Chart(option);\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "        \n",
       "    });\n",
       "        &lt;/script&gt;\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\" height=600 width=750></iframe>"
      ],
      "text/plain": [
       "<highcharts.highcharts.highcharts.Highchart at 0x7f6abc741050>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from highcharts import Highchart\n",
    "H = Highchart(width=750, height=600)\n",
    "\n",
    "data1 = [502, 635, 809, 947, 1402, 3634, 5268] # data for Asia\n",
    "data2 = [106, 107, 111, 133, 221, 767, 1766] # data for Africa\n",
    "data3 = [163, 203, 276, 408, 547, 729, 628] # data for Europe\n",
    "data4 = [18, 31, 54, 156, 339, 818, 1201] # data for America\n",
    "data5 = [2, 2, 2, 6, 13, 30, 46] # data for Oceania\n",
    "\n",
    "\n",
    "options = {\n",
    "    'title': {\n",
    "        'text': 'Historic and Estimated Worldwide Population Growth by Region'\n",
    "    },\n",
    "    'subtitle': {\n",
    "        'text': 'Source: Wikipedia.org'\n",
    "    },\n",
    "    'xAxis': {\n",
    "        'categories': ['1750', '1800', '1850', '1900', '1950', '1999', '2050'],\n",
    "        'tickmarkPlacement': 'on',\n",
    "        'title': {\n",
    "            'enabled': False\n",
    "        }\n",
    "    },\n",
    "    'yAxis': {\n",
    "        'title': {\n",
    "            'text': 'Billions'\n",
    "        },\n",
    "        'labels': {\n",
    "            'formatter': 'function () {\\\n",
    "                                return this.value ;\\\n",
    "                            }'\n",
    "        }\n",
    "    },\n",
    "    'tooltip': {\n",
    "        'shared': True,\n",
    "        'valueSuffix': ' millions'\n",
    "    },\n",
    "    'plotOptions': {\n",
    "        'area': {\n",
    "            'stacking': 'normal',\n",
    "            'lineColor': '#666666',\n",
    "            'lineWidth': 1,\n",
    "            'marker': {\n",
    "                'lineWidth': 1,\n",
    "                'lineColor': '#666666'\n",
    "            }\n",
    "        }\n",
    "    }\n",
    "}\n",
    "\n",
    "H.set_dict_options(options)\n",
    "\n",
    "H.add_data_set(data1, 'area', 'Asia')\n",
    "H.add_data_set(data2, 'area', 'Africa')\n",
    "H.add_data_set(data3, 'area', 'Europe')\n",
    "H.add_data_set(data4, 'area', 'America')\n",
    "H.add_data_set(data5, 'area', 'Oceania')\n",
    "\n",
    "H"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
